﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Omu.AwesomeMvc;
using MvcApplication4.Models;


namespace MvcApplication4.Controllers
{
    public class Vacina1AjaxDropdownController : Controller
    {
        public Vacina1AjaxDropdownController()
        {
            
        }

        private readonly BD_Vacinas2Context _db = new BD_Vacinas2Context();

        public ActionResult GetItems(int? v)
        {

            return Json(_db.tb_Vacina.ToList().Select(o => new SelectableItem(o.ID_Vacina, o.Nome_Vacina, v == o.ID_Vacina)));
            // key, text, selected
        }

    }
}
